package com.lntea.jdbc.dbutils;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.dbutils.handlers.BeanHandler;

public class BeanHandlerDemo {
	public static void main(String[] args) throws SQLException {
		ResultSetHandler<User> h = new BeanHandler<User>(User.class);
		QueryRunner queryRunner = new QueryRunner();
		User user = queryRunner.query(ConnectionUtil.getConnection(), "select * from user where name=?", h,"jack");
		System.out.println(user);
	}
}


